<template>
	<view class="pay_content">
		<view class="pay_info">
			<view class="pay_phone">联系方式：{{navList.phone}}</view>
			<view class="pay_phone">交易金额：12323.33元</view>
		</view>
		<view class="pay_title">支付宝付款</view>
		<view class="pay_type">
			<label class="radio"><radio v-model="radio" value="r1" :checked="true" /></label>
			<view class="pay_right">
				<view class="pay_phone">收款人姓名：{{navList.aliName}}</view>
				<view class="pay_phone">收款人账号：{{navList.aliPay}}</view>
			</view>
		</view>
		<view class="pay_title">银行卡付款</view>
		<view class="pay_type">
			<label class="radio"><radio v-model="radio" value="r2" :checked="false" /></label>
			<view class="pay_right">
				<view class="pay_phone">银行名称：{{navList.bankNickName}}</view>
				<view class="pay_phone">收款人账号：{{navList.bankName}}</view>
				<view class="pay_phone">卡号：{{navList.bankNo}}</view>
			</view>
		</view>
		<view class="pay_title">微信付款</view>
		<view class="pay_type">
			<label class="radio"><radio v-model="radio" value="r3" :checked="false" /></label>
			<view class="pay_right">
				<view class="pay_phone">银行名称：{{navList.wxName}}</view>
				<view class="pay_phone">收款人账号：{{navList.wxNo}}</view>
			</view>
		</view>
		
		<view class="pay_btn" @click="userconfirm">我已打款</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				radio: "r1",
				navList:{},
				orderId:"",
			}
		},
		onLoad(options) {
			console.log("options",options);
			console.log("options",options);
			this.orderId=options.orderId
			this.getUserData(options.shopId)
		},
		methods: {
			getUserData(shopId){
				
				const that = this
				console.log("getUserData",shopId);
				that.$api.request('/api/web','/getUserData',{
					
				}, failres => {
					console.log("failres",failres);
					
					uni.showToast({
						title: failres.msg,
						icon: "none"
					});
				}).then(res => {
					console.log("then res",res);
					that.navList=res.data;
					
				//console.log(": " + JSON.stringify(res));
				
				})
			},
			
			//付款确认
			
		
			
			userconfirm(shopId){
				
				const that = this
				that.$api.request('/api/web','/confirm',{
					orderId:this.orderId,//订单号
					status:'1',//状态（1确认付款）
				}, failres => {
					console.log("failres",failres);
					
					uni.showToast({
						title: failres.msg,
						icon: "none"
					});
				}).then(res => {
					
					that.navList=res.rows;
					uni.showToast({
						title: "已处理",
						icon: "none"
					});
					uni.navigateTo({
						url: '/pages/order/list'
					})
				/* console.log(": " + JSON.stringify(res)); */
				
				})
			},
			
		}
	}
</script>

<style lang="scss">
	.pay_content{
		background: #F6F6F6;
		min-height: 100vh;
		padding-top: 20upx;
		padding-bottom: 20upx;
		.pay_phone{
			margin-left: 20upx;
			line-height: 80upx;
			font-size: 28upx;
		}
		.pay_info{
			width: 100%;
			background: #FFFFFF;
			padding: 20upx 0;
		}
		.pay_title{
			text-align: center;
			font-size: 28upx;
			line-height: 80upx;
		}
		.pay_type{
			width: 100%;
			background: #FFFFFF;
			padding: 20upx 0;
			display: flex;
			align-items: center;
			.pay_right{
				width: 80%;
				padding: 20upx 0;
				border: 1upx solid #efefef;
				margin-left: 20upx;
			}
			.radio{
				margin-left: 20upx;
			}
		}
		.pay_btn{
			width: 90%;
			height: 80upx;
			background: #4399FC;
			color: #FFFFFF;
			font-size: 28upx;
			line-height: 80upx;
			text-align: center;
			margin: 0 auto;
			margin-top: 20upx;
			border-radius: 10upx;
		}
		
		
	}
</style>
